package com.comba.nutz.boot.auth.server.service.impl;

import com.comba.nutz.boot.auth.server.entity.ClientEntity;
import com.comba.nutz.boot.auth.server.service.ClientService;
import com.comba.nutz.boot.starter.dao.CndPlus;
import com.comba.nutz.boot.starter.impl.BaseServiceImpl;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.ClientRegistrationException;
import org.springframework.stereotype.Service;

/**
 * @author george
 */
@Service
public class ClientServiceImpl extends BaseServiceImpl<ClientEntity> implements ClientService {

    @Override
    public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
        ClientEntity clientEntity = fetch(CndPlus.where("client_id", clientId));

        return clientEntity;
    }

}
